<?php 

/*
 *------------------------------------------------------------------------------
 * Project Name  : e-Synergy Library System
 *         Code  : ESN-LBS
 *
 * Created By    : Junlapong
 *         Date  : 2009/08/27
 *
 * $Id$
 *------------------------------------------------------------------------------
 *    copyright: e-Synergy Co., Ltd.
 *==============================================================================
 */

if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class MY_Controller extends Controller
{	
	function MY_Controller()
	{	
		parent::Controller();
		log_message('debug', 'MY_Controller Class Initialized');

		$this->lang->set_lang('th');
		
		$login_page = defined('LOGIN_PAGE');
		$test_page  = defined('TEST_PAGE');
		
		$sess_expired = $this->session->get("login_status") !== LOGIN_STATUS_ONLINE;

		if (!($login_page || $test_page) && $sess_expired)
		{
			header("Content-Type: text/html");
			
			echo '<script language="JavaScript">';
			echo 'window.open("' . site_url('login') . '", "_top");';
			echo '</script>';
		}		
	}
}

// END MY_Controller class

/* End of file MY_Controller.php */
/* Location: application/libraries/MY_Controller.php */